﻿// =================================================================== 
// 项目说明
//====================================================================
// liucx @Copy Right 2019
// 文件： InsureRepository.cs
// 项目名称：斑马车务
// 创建时间：2019/9/17
// 负责人：liucx
// ===================================================================
using System;
using System.Text;
using System.Collections.Generic;
using YouWei.Infrastructure.Entity;

namespace YouWei.Infrastructure.Repository
{
    /// <summary>
    /// 仓储层
    /// </summary>	
    public class InsureRepository : BaseRepository<Insure>
    {

        #region 构造

        public InsureRepository() : base() { }

        public InsureRepository(string connectionString) : base(connectionString) { }

        public InsureRepository(DatabaseContext dbContext) : base(dbContext) { }

        #endregion
        /// <summary>
        /// 根据用户ID获取保险详情
        /// </summary>
        /// <param name="mobile"></param>
        /// <returns></returns>
        public Insure GetByUser(int UserID)
        {
            StringBuilder sb = new StringBuilder("SELECT * FROM Insure T WITH(NOLOCK) ");
            sb.Append(" WHERE T.UserID = @UserID");
            return FirstOrDefault(sb.ToString(), new { UserID = UserID });
        }
    }
}